<template>
	<view class="content" v-if="incubatorsList!=''">
		<view class="title">
			{{incubatorsList.title}}
		</view>
		
		<view class="article">
			<view class="text">
				<mp-html :content="incubatorsList.content" />
			</view>
		</view>
	</view>
	<view style="text-align: center;" v-else>暂无数据</view>
</template>

<script>
	import {
		getIncubatorsListApi,
		getIncubatorsByIdApi,
		getIncubatorsArticleByFatherIdApi
	} from '@/api/incubation_base.js';
	export default{
		data(){
			return{
				incubatorsList:{
					title:'',
					content:'',
				},
				type: 1,
				fatherId: 1
			}
		},
		methods:{
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			getIncubatorsArticleByFatherId() {
				getIncubatorsArticleByFatherIdApi({
					type: this.type,
					fatherId: this.fatherId,
				}).then((res) => {
					this.incubatorsList = res ?? [];
					console.log(this.incubatorsList)
				})
			},
		},
		onLoad(e) {
			this.fatherId = e.fatherId;
			console.log(e)
			this.type = e.type
			this.getIncubatorsArticleByFatherId()
		}
	}
</script>

<style lang="scss" scoped>
	
	.content{
		padding: 30rpx;
		
		.title{
			font-size: 40rpx;
			font-weight: 900;
		}
		
		.data{
			margin-top: 30rpx;
			color: #888888;
			font-size: 30rpx;
		}
		
		
		.article{
			margin-top: 50rpx;
			
			.text{
				text-indent: 2em;
				font-size: 35rpx;
				line-height: 55rpx;
			}
		}
		
	}
</style>